home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 18520 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  6.6 KB

  1. Path: sky.net!not-for-mail
  2. From: williams@sky.net (Eric Williams)
  3. Newsgroups: comp.lang.java,comp.lang.c++,comp.lang.smalltalk
  4. Subject: Re: Will Java kill C++?
  5. Date: 21 Apr 1996 00:32:24 -0500
  6. Organization: SkyNET Online
  7. Message-ID: <4lch98$k5k@sky.net>
  8. References: <4ks0c8$jte@piglet.cc.uic.edu> <DpvsE5.2HC@research.att.com> <4ksfdr$bhh@engnews2.Eng.Sun.COM> <DpwM4M.KC7@research.att.com>
  9. NNTP-Posting-Host: solar.sky.net
  10.  
  11. Andrew Koenig <ark@research.att.com> wrote:
  12. >In article <4ksfdr$bhh@engnews2.Eng.Sun.COM> linden@positive.Sun.COM (Peter van der Linden) writes:
  13. >
  14. >> Andrew Koenig <ark@research.att.com> wrote:
  15. >> > why aren't you agitating for a name-mangling standard in C?
  16. >> > Name mangling is a potential problem there too.
  17. >
  18. >> It may be a potential problem, but name mangling isn't an actual problem in C.  
  19. >> Names either don't get mangled, or everyone mangles them the same trivial way.
  20. >
  21. >That's actually not quite true.  For example, some C compilers put an
  22. >underscore at the beginning of external names, and others don't.  I imagine
  23. >there are other possibilities too.
  24.  
  25.  
  26. There's one essential problem you're not discussing..... if you violate
  27. a platform's abi by creating your own naming standard for C symbols (or
  28. violate something else in the abi), how will you market your product?
  29. The marketplace has not tolerated this sort of deviation well, and you
  30. will find non-conforming C compilers to be a hard sell indeed....  The
  31. marketplace seems to accept de-facto standards where no official
  32. standards exist.  I'd even go a step further to state that on most
  33. platforms, the hardware/OS *vendor* is expected to provide the de-facto
  34. standards.
  35.  
  36. I think these kind of de-facto standards are very powerful.  For example,
  37. gcc has been accepted on unix platforms to a much greater degree than g++
  38. partly because gcc is mostly compatible with the standards and conventions
  39. on each platform --- g++ remains largely incompatible with the "standard"
  40. (i.e., vendor-supplied) C++ compiler on each platform.
  41.  
  42.  
  43. I realize that it's not just name-mangling conventions that cause 
  44. incompatibility between C++ compilers on the same platform..... 
  45. just thinking about object layouts involving virtual base classes is
  46. enough to give me fits and starts.  But I think the answer to why C++
  47. compilers remain incompatible has more of an explanation than "it's too
  48. hard to express the concepts".  There are several reasons why C++
  49. compilers are incompatible:
  50.  
  51.   * Complexity - The inherent complexity of C++ has led to a number
  52.     of truly creative solutions to the problems in the C++ compiler
  53.     design space.  Unfortunately, once these investments were made,
  54.     it became very difficult to change.  If you've already got a
  55.     solution, why would you want to re-engineer your compiler ---
  56.     the thing was damn hard to get right in the first place.
  57.  
  58.   * Complexity (again) - So much energy was expended in fighting
  59.     about complex C++ features during ANSI standardization that nobody
  60.     wanted or had enough energy to fight about "compatibility".
  61.     Plus, everyone knew that it would be a lost cause anyway ---
  62.     there would be too much vendor opposition to get it through
  63.     the committee.
  64.  
  65.   * Competition - If you standardize your implementation, you open
  66.     the doors for competition.  Why would you want to do that? 
  67.     Cross-platform compiler vendors have had no chance in the C++
  68.     market.  For an example, look at CenterLine:  when everyone was
  69.     using cfront, they had a market..... but now that each vendor
  70.     is implementing a different solution, they can't even keep
  71.     a debugger up to date across platforms, much less the compiler.
  72.  
  73.   * It's *my* solution - We don't like to admit it, but as engineers
  74.     we *love* re-inventing the wheel in different ways.  If the
  75.     business constraints let us get creative, we will --- we'll
  76.     create the best solution we can think of, and then fight tooth
  77.     and nail if someone suggests that it's not an optimal solution.
  78.  
  79. If the major C++ vendors had thought that link-compatibility
  80. was a major issue, the technical details would have been worked
  81. out --- even though it's a non-trivial task.
  82.  
  83.  
  84. >> Let's try and face up to the deficiencies of C++.  Not say "well C might
  85. >> be just as bad".  When we admit the deficiencies of C++, we can start to
  86. >> look for something better.  No programming language is perfect, let's just
  87. >> try to make them monotonically better.
  88. >
  89. >I completely agree with you.  But that is no excuse for inventing deficiencies
  90. >that do not exist.
  91.  
  92. Name-mangling can still be considered a hack, in the sense that each
  93. vendor worked out their own solution.  That's the essential point of
  94. this whole discussion --- each C++ vendor's solution is different.
  95.  
  96. My personal intuition says that compatibility is one of the major
  97. factors behind the conversion of droves of C++ afficianadios to Java,
  98. right behind "reduced complexity".  There aren't 27 different solutions
  99. to template instantiation any longer --- in fact, templates themselves
  100. are no more.
  101.  
  102. C++ was intially a "cool" language to learn..... then developers started
  103. to use it in large projects, and began to see it as "complex"..... and
  104. now many feel that the complexity is unmanageable.  You almost have to
  105. have a compiler expert on every project just to work through compiler
  106. differences and to diagnose compiler bugs.  Java eliminates a good deal
  107. of this complexity, and that's why experienced C++ programmers are
  108. jumping ship --- it is easier to teach your co-workers how to use
  109. Java than it is to teach them how to use C++.  And you get a bigger bang
  110. for your buck..... e.g., you can *actually* think about writing multi-
  111. threaded programs.  By eliminating much of the complexity and platform
  112. differences, it is as if developers have more room in their brains to
  113. store the advanced concepts, such as exception handling and concurrency
  114. control.
  115.  
  116. With Java, it won't even matter what platform you use for development....
  117. your applets/applications should work the same on every platform.  (Ok,
  118. that is a little over-optimistic, but it's certainly better than creating 
  119. a separate three-month project just to port your application once it has
  120. been shipped on a reference platform.)
  121.  
  122.  
  123. I will be very interested to see how things progress for Java if/when
  124. it undergoes standardization....  And even before that, how will the
  125. market react to implementations that materially diverge from the
  126. specified standards and unspecified conventions of Java?  The market
  127. is the driving force here --- if the market wants features over
  128. compatibility, then they will get it.  If compatibility remains a high
  129. priority, then incompatible implementations will not survive.
  130.  
  131.  
  132. -eric
  133. -----
  134. williams@sky.net
  135.